<script type="text/javascript" src="<?php echo js_link("order.js","admin");?>"></script>
<?php echo $this->message->display();?>
<h1>Customers management</h1>
    <div class="toppage">
    	<span class="left">
            <input type="text" name="keys" id="keys" value="Keyword" onblur="if(this.value=='') this.value='Keyword';" onfocus="if(this.value=='Keyword') this.value='';" style="width:165px; padding:3px;" />
            <input type="text" name="keys" id="keys" value="Email" onblur="if(this.value=='') this.value='Email';" onfocus="if(this.value=='Email') this.value='';" style="width:165px; padding:3px;" />
            <input type="submit" name="" value="Filter" class="btn" />
        </span>
        <input type="hidden" name="base_url" id="base_url" value="<?php echo admin_url("customer/my_order_create");?>" />
        <span class="btnadd"><a href="javascript:void(0)" id="add_new_customer" onclick ="">Add new customer</a></span>
        <span class="btnadd"><a href="javascript:void(0)" id="add_new_order" onclick ="">Add new order</a></span>
    </div>
    
    <div class="topart">
    	<span class="left">
    		<font class="number">(<?php echo $total_cus;?>)</font> <a href="javascript:void(0);">All Customers</a><font class="line">|</font><font class="number">(<?php echo $total_activ;?>)</font> <a href="javascript:;"><font color="#0b9901">Active</font></a>
        </span>
        <span class="right1">
        	<select style="width:50px;">
            	<option value="1">30</option>
                <option value="2">50</option>
                <option value="3">100</option>
            </select>
            <input type="hidden" name="base_url" id="base_url" value="<?php echo admin_url("customer/edit");?>" />
            <div class="pagination">
<?php 
			echo $pagnav;
?>
            </div>
        </span>
        
    </div>
    
    <div class="tableout">
		<div class="title1">
        	<div class="column" style="width:2%;"><input type="checkbox" name="check_all_01" value="" id="check_all_01" /></div>
            <div class="column" style="width:10%;">Customer ID</div>
            <div class="column" style="width:20%;">Name</div>
            <div class="column" style="width:20%;">Email</div>
            <div class="column" style="width:25%;">Country - IP</div>
            <div class="column" style="width:13%;">Phone Number</div>
            <div class="column" style="width:4%;">Status</div>
        </div>
<?php 
		$i = 0;
		foreach($list_customer as $list)
		{
?>        
        
        <div class="linecate2">
        	<div class="column" style="width:2%;"><input type="checkbox" name="customer_id[]" value="<?php echo $list['id']?>" /></div>
            <div class="column" style="width:10%;"><?php echo $list['id'];?></div>
            <div class="column" style="width:20%;" onmouseover="Hovercat('<?php echo $i;?>')" onmouseout="Outcat('<?php echo $i;?>')">
            	<a href="javascript:;" class="art"><?php echo $list['title']." ".$list['fullname'];?></a><br />
                <div class="action" id="neocat-<?php echo $i;?>">
                	<?php if($this->module_model->check_action($_SESSION['_admin']['group_id'],$this->router->class,'customers_edit')):?>
                    <a href="javascript:void(0);" onclick="edit_cus('<?php echo admin_url('customer/customers_edit?cus_id='.$list['id'].'')?>', <?php echo $list['id'];?>)">Edit</a>
                    <?php endif;?>
                    <a href="javascript:void(0);" onclick="view_cus('<?php echo admin_url('customer/customers_edit?cus_id='.$list['id'].'&view=yes')?>')">Detail</a>
                </div>
            </div>
            <div class="column" style="width:20%;">
            	<a href="javascript:;" class="art"><?php echo $list["email"];?></a>
            </div>
            <div class="column" style="width:25%;">
            	<?php echo $list["country"];?> - <font color="#777"><?php echo $list["last_ip"];?></font>
            </div>
            
            <div class="column" style="width:13%;">
            	<?php echo $list["telephone"];?>
            </div>
            <div class="column" style="width:4%;">
            <?php $img_name = ($list["active"]=='yes') ? "active.png" : "pending.png"?>
            <a href="#"><img src="<?php echo img_link($img_name, "admin")?>" class="icon png" title="Active" alt="Active" /></a>
            </div>
        </div>
<?php 
		$i++;
		}
?>
        
        <div class="bottom1">
        	<div class="column" style="width:2%;"><input type="checkbox" name="check_all_02" value="" id="check_all_02" /></div>
            <div class="column" style="width:50%;"><span></span></div>
            <span class="right1">
                <div class="pagination">
<?php 
				echo $pagnav;
?>
                </div>
            </span>
        </div>
    </div>
    
<div id="light" class="white_content">
	<div class="editart_top">
		<span class="left3">
		<h2>Edit customer</h2>
	    </span>
		<a href = "javascript:void(0)" onclick ="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"><img src="<?php echo img_link("close.png", "admin")?>" class="png" /></a>
    </div>
    <form action="<?php echo admin_url('customer/customers')?>" method="post" id="edit_cus">
		<div class="editcate_ct" id="content">
			
		    
		</div>
		<div class="btarticle">
	    	<input type="button" name="close" value="Cancel" class="btn" />
	        <input type="submit" name="" value="Save & Continute" class="btn" />
	    </div>
	</form>
</div>
<div id="fade" class="black_overlay"></div>
    